Learn about expect script command line arguments, we have the largest and most updated expect script command line arguments information on alibabacloud.com
background: In the remote file download, you need to enter the other party's server password, the shell does not support interactive input content, can be implemented in the following two ways I. Embedding expect in shell scripts for password
Expect is a tool built on TCL to automate tasks that require interaction.Because expect is TCL-based, you need to have TCL installed in your systemHow to check?[Email protected] ~]# Whereis tclTcl:/usr/lib/tcl8.4/usr/share/tcl8.4If you do not see
Recent project requirements, need to write some shell script interaction, the pipeline is not enough time, expect can be very good to implement the interaction between the script, search for information, found that many articles on the Web are
usage1. [#!/usr/bin/expect]This line tells the code in the operating system script to use that Shell to execute. The expect here is actually a kind of thing with bash under Linux and cmd under Windows.Note: This line is required on the first line of
1, before using expect, need to install two RPM package,
The code is as follows
Copy Code
# RPM-IHV expect-5.43.0-8.el5.i386.rpm# RPM-IHV expect-devel-5.43.0-8.el5.i386.rpm
2, the batch modifies the password
1. Source of demandSometimes we need to write some scripts to deal with some tasks, may enter different commands according to different conditions, to accomplish different tasks. Can you do the same thing as the Linux operating system, looking a
Introduction
Can you write command-line tools? Maybe you can, but can you write a really useful command-line tool? This article discusses using Python to create a robust command-line tool with built-in Help menus, error handling, and option
Introduction
Can you write command line tools? Maybe you can, but can you write a really useful command-line tool? This article discusses the use of Python to create a robust command-line tool with built-in Help menus, error handling, and option
IntroductionAwk is a powerful text analysis tool, with the search for grep and the editing of SED, which is especially powerful when it comes to analyzing data and generating reports. To put it simply, awk reads the file line-by-row, using spaces as
1) How do I pass parameters to a script?./script argumentExample : Show file name script./show.sh File1.txtcat Show.sh#!/bin/bashcat $2) How do I use parameters in a script?First parameter: $ $, second argument: $ AExample: The script will copy the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.